import React from 'react'

import Context from '@/utils/context'

export default WrapComponent => {
  return class extends React.Component {
    render() {
      return (
        <Context.Consumer>
          {theme => (
            <div id="theme" style={{color: theme.color, backgroundColor: theme.backgroundColor}}>
              <WrapComponent {...this.props} />
            </div>
          )}
        </Context.Consumer>
      )
    }
  }
}